<?php
namespace App\Http\ViewComposers;

use App\Libs\CommonUtils;
use Illuminate\Http\Request;
use Illuminate\View\View;

class AdminComposer {
    private $data = null;

    public function __construct(Request $request)
    {
        $this -> data = new CommonUtils($request);//新建一个CommonUtils对象
    }
    public function compose(View $view)
    {
        $view -> with([
            'menus' => $this -> data -> menu,
        ]);
    }
}
